import store from "@/store"
import { getPropsList,resetAttr } from "../attr"
import { dateFormatOptions,defaultFarmat } from "../../lib/const"
import { setDateSelectFields } from "../../lib/date"
const attr = ({dateFilterFieldList = [], props = {...defaultFarmat}}) => [
  {
    type: "input",
    label: "标题",
    fieldName: "title",
    extraConfig: {
      className: "row",
    },
    dataType: String,
  },
  // {
  //   type: "select-group",
  //   label: "筛选字段",
  //   fieldName: "filterField",
  //   options: dateFilterFieldList,
  //   extraConfig: {
  //     className: "row",
  //   },
  //   dataType: String,
  // },
  {
    type: "multiple-field-select",// "multiple-field-select",
    label: "筛选字段",
    fieldName: "filterField",
    extraConfig: {
      className: "row",
      mode: "multiple"
    },
    options: dateFilterFieldList,
    dataType: Array,
      onChange: setDateSelectFields,
  },
  {
    type: "select",
    label: "展示格式",
    fieldName: "format",
    options: dateFormatOptions,
    extraConfig: {
      className: "row",
    },
    dataType: String,
  },
  {
    type: "date-range",
    placeholder: [`开始时间`,'结束时间'],
    label: "默认值",
    fieldName: "value",
    // format:"format",
    extraConfig: {
      className: "row",
      format: props.format,
      valueFormat: props.valueFormat,
    },
    dataType: Array,
  },
]
export function getProps(){
  return getPropsList(attr({}))
}

export default {
  attr,
  // isNoCommon: true
}


